package com.spa.application.command.admin;

import com.spa.application.command.common.rule.RuleAddCommand;
import com.spa.infrastructure.util.UrlUtil;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

@Data
public class MassagistAdminEditCommand {

    @NotNull
    private Long massagistId;

    @NotBlank
    private String name;

    @NotBlank
    private String workPhoto;

    @NotBlank
    private String lifePhoto;

    @NotBlank
    private String lengthOfEmployment;

    @NotNull
    private List<Long> serviceList;

    @NotBlank
    private String introduce;

    @NotBlank
    private String idCardTails;

    @NotBlank
    private String idCardFront;

    @NotNull
    private Long shopId;

    private String qualificationCertificate;

    private String healthCertificate;

    @NotNull(message = "规则必填")
    private List<RuleAddCommand> ruleDtoList;

    public void setWorkPhoto(String workPhoto) {
        this.workPhoto = UrlUtil.handleUrl(workPhoto, ",");
    }

    public void setLifePhoto(String lifePhoto) {
        this.lifePhoto = UrlUtil.handleUrl(lifePhoto, ",");
    }

    public void setIdCardTails(String idCardTails) {
        this.idCardTails = UrlUtil.handleUrl(idCardTails, ",");
    }

    public void setIdCardFront(String idCardFront) {
        this.idCardFront = UrlUtil.handleUrl(idCardFront, ",");
    }

    public void setQualificationCertificate(String qualificationCertificate) {
        this.qualificationCertificate = UrlUtil.handleUrl(qualificationCertificate, ",");
    }

    public void setHealthCertificate(String healthCertificate) {
        this.healthCertificate = UrlUtil.handleUrl(healthCertificate, ",");
    }
}
